package com.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.Dao.userdao;
import com.pojo.User;

public class selectuserservlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
			this.doPost(request, response);
		}
		
	public void doPost(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
			request.setCharacterEncoding("utf-8");
			String id = request.getParameter("userid");
			int userid = Integer.parseInt(id);
			userdao udao = new userdao();
			User u = udao.selectuserbyid(userid);
			//System.out.println(g);
			request.getSession().setAttribute("Userinfo", u);
			request.getRequestDispatcher("/background/goodsdetails.jsp").forward(request, response);
			
		}


}
